package com.example.mes.schedule;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

//@Configuration
//@EnableScheduling
public class DataSchedule {
    int i =1;
//    @Scheduled(fixedRate = 2000)
//    @Async
    public void contextLoads() throws InterruptedException {
        Thread.currentThread().setName("thread"+i++);
        while(true){
            System.out.println(Thread.currentThread().getName()+i);
            Thread.sleep(2000);
        }

    }
}
